int findOverNum(int a[], int n, int num)
{
    int ret = 0x3f3f3f3f;
    int flag = 1;
    int index = -1;
    for (int i = 0; i < n; i++)
    {
        if (a[i] > num && a[i] < ret)
        {
            flag = 0;
            ret = a[i];
            index = i;
        }
    }
    return index;
}